#include <iostream>
using namespace std;

class AAA
{
public:
	virtual void fct() {
		cout << "AAA"<<endl;
	}
};

class BBB : public AAA
{
public:
	void fct() {	//virtual void fct() 
		cout << "BBB" << endl;
	}
};

class CCC : public BBB
{
public:
	void fct() { 
		cout << "CCC" << endl;
	}
};

int main()
{
	BBB *b = new BBB;
	b -> fct();
	
	AAA *a = new AAA;
	a -> fct();

	delete b;

	return 0;
}